package com.libra.assemble.web.form;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 保存由Controller操作后返回到页面的消息主体。
 * 
 * @author Libra
 *
 */
public class ActionMessageForm {

	/** 状态 可选内容：success | info | warning | danger */
	private String state;

	/** 强调 */
	private String strong;

	/** 消息 */
	private String message;

	/**
	 * 构造函数.
	 * 
	 * @param state
	 *            状态 可选内容：success | info | warning | danger
	 * @param message 消息主体
	 */
	public ActionMessageForm(String state, String message) {
		this.state = state;
		this.message = message;
	}

	/**
	 * 构造函数.
	 * 
	 * @param state
	 *            状态 可选内容：success | info | warning | danger
	 * @param strong 强调描述
	 * @param message 消息主体
	 */
	public ActionMessageForm(String state, String strong, String message) {
		this.state = state;
		this.message = "<strong>" + strong + "</strong> " + message;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStrong() {
		return strong;
	}

	public void setStrong(String strong) {
		this.strong = strong;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * 覆盖toString方法，目的显示所有JavaBean的属性值，省略写很多的getXxx的方法
	 */
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

}
